<%@ page contentType="text/html; charset=utf-8" import="java.util.*,common.*" %>
<%
UserSession userSession = (UserSession)session.getAttribute("user");
String userName = userSession.getUser_name();

%>
<script>
function go_submit(){
	var frm = document.mainform;	
	if (frm.s_rpt_title.value == '') {
		alert("제목을 입력해 주세요.");
		frm.s_rpt_title.focus();
		return;
	}
	if (frm.s_rpt_cont.value == '') {
		alert("내용을 입력해 주세요.");
		frm.s_rpt_cont.focus();
		return;
	}
	/*
	if (frm.attachFile.value == '') {
		alert("첨부파일을 등록해 주세요.");
		return;
	}
	*/
	frm.action = '/speaking.pb?cmd=test_insert';
	frm.target= '_self';              
	frm.submit();	
}

function down_file(id, id_old,folder){
	frm = document.down1;
	frm.action = '/speaking.pb';
	frm.cmd.value='download'; 
	frm.file_id.value=id_old;
	frm.file_name.value=id;
	frm.file_folder.value=folder;            
	frm.target= '_self';              
	frm.submit();   		
}
</script>
</head>
<body style="overflow-x:hidden;">
<form name="down1"  method="post" action = "/speaking.pb" >
<input type="hidden" name="cmd" value="">
<input type="hidden" name="file_id" value="">
<input type="hidden" name="file_folder" value="">
<input type="hidden" name="file_name" value="">
</form>
<form name="mainform"  method="post" action = "/speaking.pb" enctype= "multipart/form-data">
<input type="hidden" name="cmd" value="">
		
<input type="hidden" name="file_size" value="">
  <div id="homework-wrapper">
<!-- 과제제출 -->
  <div class="homework-div">
    <table class="">
      <tr>
        <th><label for="title">제목 : <%=userName %> </label></th>
        <td ><input name="s_rpt_title" type="text" class="input-title" value=""/></td>
      </tr>
      <tr>
        <th class="under"><label for="file">첨부1 : </label></th>
        <td  class="under"><input name="attachFile_1" type="file" /></td>
      </tr>
      
      <tr>
        <th class="under"><label for="file">첨부2 : </label></th>
        <td  class="under"><input name="attachFile_2" type="file" /></td>
      </tr>
      
      <tr>
        <th class="under"><label for="file">첨부3 : </label></th>
        <td  class="under"><input name="attachFile_3" type="file" /></td>
      </tr>
	
	  

    </table>
    <table class="board-view-contents table-width">
      <tr>
        <th>내용 : </th>
        <td class="contents"><textarea name="s_rpt_cont" cols="" rows=""  class="input-commnet"></textarea></td>
      </tr>
    </table>
  </div>
  <div class="board-btn center"><a href="javascript:go_submit();">submit</a> </div><br />
  
  
  </div>
</form>
</body>
</html>